<template>
  <div class="win-ctl">
    <MinusOutlined @click="handleMinimize" />
    <ExpandOutlined @click="handleMaximize" />
    <CloseOutlined @click="handleClose" />
  </div>
</template>

<script setup>
import { CloseOutlined, MinusOutlined, ExpandOutlined } from '@ant-design/icons-vue'

// 窗口控制处理函数
const handleMinimize = () => {
  if (window.api && window.api.windowControl) {
    window.api.windowControl.minimize()
  }
}

const handleMaximize = () => {
  if (window.api && window.api.windowControl) {
    window.api.windowControl.maximize()
  }
}

const handleClose = () => {
  if (window.api && window.api.windowControl) {
    window.api.windowControl.close()
  }
}
</script>

<style scoped>
.win-ctl {
  display: flex;
  align-items: center;
  gap: 20px;
  -webkit-app-region: no-drag;
  cursor: pointer;
}

.win-ctl svg {
  transition: color 0.3s ease;
  padding: 4px;
  border-radius: 4px;
}

.win-ctl svg:hover {
  color: #1890ff;
  background-color: rgba(24, 144, 255, 0.1);
}
</style>